import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// 主题切换
import 'element-plus/theme-chalk/dark/css-vars.css'

// main.js:注册所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 表格内容不换行
import {getColumnWidth} from '@/components/table/el_table.js'
// 操作自适应
import { getOperatorWidth} from '@/components/table/el_tableOperation.js'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.config.globalProperties.$getTableColumnWidth = getColumnWidth;
app.config.globalProperties.$getOperatorWidth = getOperatorWidth;


app.provide('global_code', "code");
app.use(createPinia())
app.use(router)
app.use(ElementPlus, {
    locale: zhCn,
  })
app.mount('#app')
